function submitFile() {
  // 获取表单和文件输入元素  
  const ImageInput = document.getElementById('imageUpload');  
  const remarks = document.getElementById('nameInput');

  if (ImageInput.files && ImageInput.files[0]) {  
    // 创建一个FormData对象  
  var formdata = new FormData();
  var myHeaders = new Headers();
  // myHeaders.append("User-Agent", "Apifox/1.0.0 (https://apifox.com)");
  myHeaders.append("Accept", "*/*");
  myHeaders.append("Host", "182.92.6.98:8090");
  myHeaders.append("Connection", "keep-alive");

  formdata.append('file', ImageInput.files[0]);

  var requestOptions = {
     method: 'POST',
     headers: myHeaders,
     body: formdata,
     redirect: 'follow'
  };

  fetch("http://182.92.6.98:8090/img/upload", requestOptions)
     .then(response => response.text())
     .then(result => {
      resultOut(result, remarks);
     })
     .catch(error => alert('error')); 

    } else {  
      console.log('No file selected.');  
    }
}

function resultOut(result, remarks)
{
  var jsonRe = JSON.parse(result);
  console.log(jsonRe.status);
  if(jsonRe.status != "MS200"){
    alert('上传图片失败');
  }else if(jsonRe.status == "MS200"){
    putImage(jsonRe, remarks);
  }
}